package com.lzy.cloud.order.service.impl;

import com.lzy.cloud.order.dtos.OrderAppealPicDto;
import com.lzy.cloud.order.entity.OrderAppeal;
import com.lzy.cloud.order.entity.OrderAppealPic;
import com.lzy.cloud.order.mapper.OrderAppealPicMapperExt;
import com.lzy.cloud.order.service.OrderAppealPicService;
import com.lzy.framework.core.utils.DozerUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description:消费者订单投诉的图片
 * @author: liyun
 * @create: 2018-07-06 16:06
 */
@Service
public class OrderAppealPicServiceImpl implements OrderAppealPicService {

    @Autowired
    private OrderAppealPicMapperExt orderAppealPicMapperExt;

    @Override
    public List<OrderAppealPicDto> queryListByAppealId(Long appealId) {
        return orderAppealPicMapperExt.queryListByAppealId(appealId);
    }

    @Override
    public Long create(OrderAppealPicDto orderAppealPicDto) {
        OrderAppealPic orderAppealPic = DozerUtils.map(orderAppealPicDto, OrderAppealPic.class);
        return orderAppealPicMapperExt.insertSelective(orderAppealPic)>0 ? orderAppealPic.getId() : 0;
    }
}
